Skip to content

MeshTools::all_rbb() to generate IGA rational quadratic meshes#4442

Open
roystgnr wants to merge 29 commits into
libMesh:develfrom
roystgnr:nurbs_generation
Open

MeshTools::all_rbb() to generate IGA rational quadratic meshes#4442
roystgnr wants to merge 29 commits into
libMesh:develfrom
roystgnr:nurbs_generation

Conversation

@roystgnr
Copy link
Copy Markdown
Member

This needs proper test coverage before merging but I've been letting it sit in a separate branch for too long and I want to at least make sure it's not interfering with any CI builds.

This takes an interpolated quadratic Lagrange mesh and turns it into an
IGA (Rational Bezier-Bernstein) mapped mesh, assuming that all curves
are intended to be circular/cylindrical/spherical.
1D on the X axis is pointless, but 1D meshes embedded in 2D or 3D space
may still benefit from perfect circles.
@moosebuild
Copy link
Copy Markdown

moosebuild commented Apr 23, 2026

Job Coverage, step Generate coverage on b520b1c wanted to post the following:

Coverage

814502 #4442 b520b1
Total Total +/- New
Rate 65.53% 65.55% +0.02% 100.00%
Hits 78425 78565 +140 177
Misses 41256 41290 +34 0

Diff coverage report

Full coverage report

This comment will be updated on new commits.

roystgnr added 2 commits May 19, 2026 10:49
I was about to stop capturing it, to fix an unused var warning, but this
is better.
@roystgnr roystgnr marked this pull request as ready for review May 20, 2026 14:14
Comment thread tests/mesh/all_rbb.C
Comment on lines +17 to +22
/**
* The goal of this test is to verify proper operation of the Mesh Extruder
* with the optional object callback for setting custom subdomain IDs.
* We pass a custom object for generating subdomains based on the old element
* ID and the current layer and assert the proper values.
*/
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/**
* The goal of this test is to verify proper operation of the Mesh Extruder
* with the optional object callback for setting custom subdomain IDs.
* We pass a custom object for generating subdomains based on the old element
* ID and the current layer and assert the proper values.
*/

or update

Comment thread tests/mesh/all_rbb.C
const Real w = node->get_extra_datum<Real>(weight_index);

CPPUNIT_ASSERT_EQUAL(Real(1), w);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

volume should be easy to check too
as well as hmin/hmax ? these change with the mapping right

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None change in this trivial remapping, but all are good to check

Comment thread tests/mesh/all_rbb.C Outdated
MeshTools::Generation::build_sphere (interior_mesh, radius,
n_refinements, QUAD9);

// Get just the outer EDGE9 circle mesh
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Get just the outer EDGE9 circle mesh
// Get just the outer EDGE3 circle mesh

Comment thread src/mesh/mesh_modification.C Outdated

// We only use [4,8) but matching indices is nice and stack is
// cheap.
// that we're only using what we set, though.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somehow missed a line deletion when I was making a huge change; thanks!

Comment thread src/mesh/mesh_modification.C Outdated
almost_equal(w[22], w[24]))
extrude_dir = 0;

if (almost_equal(w[0], w[3]) &&
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

else?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

elif

Comment thread src/mesh/mesh_modification.C Outdated
almost_equal(w[21], w[23]))
extrude_dir = 1;

if (almost_equal(w[0], w[4]) &&
Copy link
Copy Markdown
Contributor

@GiudGiud GiudGiud May 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

else if

roystgnr added 7 commits May 22, 2026 09:57
Thanks to Guillaume for catching these
This is still a hack I'm working on replacing, but now it's a *slightly
faster* hack!
Just because it's trivial doesn't definitely mean it's not broken!
Even a p=1 face can have a different volume if the vertex weights differ
and the face is embedded in 3D with non-coplanar vertices.
I'm not sure when we'll try using RBB polygons, but if we started now
we actually wouldn't need the specialization for this one.
roystgnr added 3 commits May 22, 2026 20:09
The R part is working but I didn't realize we'd never implemented the BB
part, and that'll be a separate PR.
I was trying to be clever with my if statements but I was missing out on
all sorts of complications; the code was fine but the tests weren't even
close.

Node & midnode = face.node_ref(8);
midnode.set_extra_datum<Real>(weight_index, w_mid);
midnode = ((1+w_mid)/(w_xi+w_eta) * (w_xi*xi_avg + w_eta*eta_avg) - vertex_avg)/w_mid;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
midnode = ((1+w_mid)/(w_xi+w_eta) * (w_xi*xi_avg + w_eta*eta_avg) - vertex_avg)/w_mid;
midnode = ((1.+w_mid)/(w_xi+w_eta) * (w_xi*xi_avg + w_eta*eta_avg) - vertex_avg)/w_mid;

almost_equal(w[11], w[24]) &&
almost_equal(w[20], w[25]))
extrude_dir = 2;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should you assert the coordinates fit a 2.5D extrusion, not just the weights?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the elements are coming from a regular mesh the weights are all defaults at this point?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants